package com.knowswift.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum IssueStatus {
    NEW("待审核"),
    PASS("审核通过"),
    REJECT("审核未通过");

    private final String title;

    public int getValue() {
        return ordinal() + 1;
    }

    public static IssueStatus of(int value) {
        return Arrays.stream(values()).filter(i -> i.getValue() == value).findFirst().orElse(null);
    }
}
